chrome.runtime.onInstalled.addListener(() => {
    console.log('Bookmark Manager extension installed.');
});

// chrome.bookmarks.getTree(function(bookmarks) {
//     chrome.storage.sync.set({ bookmarks }, function() {
//         console.log('Bookmarks saved to storage.');
//     });
// });

chrome.runtime.onMessage.addListener(function(message, sender, sendResponse) {
    if (message.action === 'hidePopup') {
        // chrome.action.setPopup({popup:""});
        sendResponse({status: 'popup_hidden'});
    }
    return true; // 表示你稍后会调用sendResponse()
});